﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using Photon;

public class DebugUserID : Photon.MonoBehaviour 
{


	void Start () 
	{
		
	}
	

	void Update () 
	{
		if (Input.GetMouseButtonDown(0)) 
		{	
			if(!EventSystem.current.IsPointerOverGameObject())
			{
				RaycastHit hit;

				if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 100)) 
				{	PhotonView clickedPlayer = null;
					if (hit.transform.parent.parent != null)
					clickedPlayer =  hit.transform.parent.parent.GetComponent <PhotonView> ();
					if (clickedPlayer != null)
					Debug.Log (clickedPlayer.viewID);

				}
			}
		}
	}
}
